<?php
define('SITE_PATH',   getcwd() . '/');
define('SITE_DOMAIN', $_SERVER['HTTP_HOST']);
define('SITE_ROOT',   str_replace('\\', '', dirname($_SERVER['SCRIPT_NAME'])));
define('SITE_URL',    'http://' . SITE_DOMAIN . SITE_ROOT);
define('UPLOAD_PATH', SITE_PATH . 'Public/upload/');

// 部署环境
define('DEVELOP_ENVIRONMENT',    '1');
define('TEST_ENVIRONMENT',       '2');
define('PRODUCTION_ENVIRONMENT', '3');

// 发行方式
if ($_SERVER['SERVER_ADDR'] == '127.0.0.1' || $_SERVER['HTTP_HOST'] == 'localhost') {
    define('DISTRIBUTING_TARGET', DEVELOP_ENVIRONMENT);
}else if ($_SERVER['HTTP_HOST'] == 'dev.joboto.com') {
    define('DISTRIBUTING_TARGET', TEST_ENVIRONMENT);
}else {
    define('DISTRIBUTING_TARGET', PRODUCTION_ENVIRONMENT);
}

define('APP_DEBUG',                DISTRIBUTING_TARGET == DEVELOP_ENVIRONMENT);
define('APP_STATISTICAL_ANALYSIS', DISTRIBUTING_TARGET == PRODUCTION_ENVIRONMENT);